Skip to content

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Sep 8, 2012

add pytables branch to support FDPanel

this is on top of my previous fdpanel branch
supporting put/append/select of FDPanel to hdf5 tables (and makes selection a bit more generic, as store.select() now works).

FYI - the included FDPanel definitions (eg fdpanel.py) are v1 - so merge FDPanel (v2) first
Then cherry pick this merge (eg only need pytables.py and tests and included examples)

a FDPanel is like a Panel object, but provides 4 dimensions: labels, items, major_axis, minor_axis

instead of using a dict of Panels to hold data, the FDPanel provides a convenient represenation in pandas space
with named dimensions to allow easy axis swapping and slicing

see examples/4D Example 2.pdf for creation and usage

motivation
----------
io/pytables currently provides a nice representation of a table to store a Panel object directly (assume item x major (dates) x minor)
FDPanel allows many named tables to represent a collection of these tables in a single hdf5 file

testing
-------
tests/test_fdpanel.py provides a similar methodology to test_panel.py

FDPanel is completely self contained (in core/fdpanel.py), with the exception of a single change that was needed in core/indexing.py (regarding multi indexing)

all tests that are not skipped pass (some were skipped due to deprecation of some panel like terms that are somewhat confusing in a 4D representation, e.g. minor_xs,major_xs)
some code in panel.py could be changed to avoid some method duplication in fdpanel.py (e.g. _prep_ndarray, hard coding of some axes)

this was based originally on 0.7.3 (but currently working on 0.9.dev)
…thmetic operations

all tests pass (except check_stat_op on var - the apply of np.sqrt fails on the resulting panel, very odd)
select(key, value=None, where=None):
  will now return a Panel or FDPanel if value is None and the contained objects are homogeneous DataFrames (returns Panel), or Panels (returns FDPanel)

put/append support putting/appending of FDPanel and dicts of sub-objects

test_pytables.py has been updated with a number of new tests to handle the new functionality
all existing tests pass (FDPanel functionaility should be backwards compatible)
small optimization in select

all tests pass
…g. conflict with datetime64 on existing data)
@jreback
Copy link
Contributor Author

jreback commented Nov 24, 2012

this is deprecated in implementation - updated pytables coming in future PR

@jreback jreback closed this Nov 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant